using UnityEngine;
using UnityEngine.Events;

public class TutorialStep4 : MonoBehaviour
{
	[SerializeField]
	private GameObject arrow;

	[SerializeField]
	private GUIButton target;

	private UnityAction click;

	private UnityAction stepDone;

	private void Start()
	{
		int @int = PlayerPrefs.GetInt("Tutorial");
		if (@int < 4)
		{
			arrow.SetActive(@int == 3);
			target.gameObject.SetActive(@int == 3);
		}
		else
		{
			arrow.SetActive(value: false);
		}
	}

	private void Click()
	{
		arrow.SetActive(value: false);
	}

	private void StepDone()
	{
		arrow.SetActive(value: false);
		PlayerPrefs.SetInt("Tutorial", 4);
		target.onClicked.RemoveListener(click);
		target.onEnabled.RemoveListener(stepDone);
		Object.FindObjectOfType<TutorialStep5>().Active();
	}

	public void Active()
	{
		click = Click;
		stepDone = StepDone;
		target.onClicked.AddListener(click);
		target.onEnabled.AddListener(stepDone);
		arrow.SetActive(value: true);
		target.gameObject.SetActive(value: true);
	}
}
